//
//  SGAutoButton.swift
//  songguo
//
//  Created by 潘传洲 on 16/6/17.
//  Copyright © 2016年 pcz. All rights reserved.
//

import UIKit

class SGAutoButton: UIButton {
    override func layoutSubviews() {
        super.layoutSubviews()
        imageView?.size = CGSize(width: (imageView?.image?.size.width)! / 1.2, height: (imageView?.image?.size.height)! / 1.2)
        imageView?.y = 0
        imageView?.centerX = self.centerX
        titleLabel?.font = UIFont.systemFontOfSize(12)
        titleLabel?.y = CGRectGetMaxY(imageView!.frame)
        titleLabel?.centerX = self.centerX
    }

}
